//#ifndef EquipMergeScene_h__
#ifndef _EquipMergeScene_h__
#define _EquipMergeScene_h__

#include "Global.h"




#include "../item/Item.h"
#include "../EquipIcon.h"

class EquipMergeScene
	: public State
	, public CCBMemberVariableAssigner
	, public CCBSelectorResolver
	, public CCNodeLoaderListener
{
	struct MergeItem
	{
		CCMenuItemImage* mMenuItem;
		Item* mItemIcon;
		MergeItem():mItemIcon(NULL){}
	};

public:
	CCB_STATIC_NEW_AUTORELEASE_OBJECT_WITH_INIT_METHOD(EquipMergeScene, create);

	EquipMergeScene(void);
	~EquipMergeScene(void);

	virtual SEL_MenuHandler onResolveCCBCCMenuItemSelector(CCObject * pTarget, CCString * pSelectorName);
	virtual SEL_CCControlHandler onResolveCCBCCControlSelector(CCObject * pTarget, CCString * pSelectorName);
	virtual bool onAssignCCBMemberVariable(CCObject * pTarget, CCString * pMemberVariableName, CCNode * pNode);
	virtual void onNodeLoaded(CCNode * pNode, CCNodeLoader * pNodeLoader);
	bool init();
	void refresh();
	void onEnter();
	void onExit();
private:
	CCLabelTTF* mName;
	CCLabelTTF* mType;
	CCLabelTTF* mLevel;
	CCLabelTTF* mPropertyTitle;
	CCLabelTTF* mProperty;
	CCLabelTTF* mPerfect;
	CCLabelTTF* mAddProperty;
	CCLabelTTF* mQiangHuaCost;
	CCLabelTTF* mNeedEnergy;
	CCLabelTTF* mStoveEnergy;
	CCMenuItemImage* mEquipBtn1;
	CCMenuItemImage* mEquipBtn2;
	CCMenuItemImage* mEquipBtn3;
	CCMenuItemImage* mEquipBtn4;
	EquipIcon* mEquipIcon;
	std::vector<MergeItem*> mMergeItemList;
	int curSelect;
	bool isChangeEquip;
	void meltEquip(vector<int>& equipList);
	void _onNotification(CCObject* object);
	void onEquipBgClick(CCObject* pSender);
	void onQiangHuaBtnClick(CCObject * pSender, CCControlEvent pCCControlEvent);
	void onXiLianBtnClick(CCObject * pSender, CCControlEvent pCCControlEvent);
	void onSupplyBtnClick(CCObject * pSender, CCControlEvent pCCControlEvent);
	void onChangeEquipBtnClick(CCObject * pSender, CCControlEvent pCCControlEvent);
};

#endif